package spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Test01 {

    public static void main(String[] args) {
        //加载spring配置文件
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring01.xml");
        StudentController sc = (StudentController) ac.getBean("sc");
        Student s = sc.getStudent();
        System.out.println(s);

        List<Student> list = sc.findStudent();
        for (Student stu:list) {
            System.out.println(stu);
        }

    }
}
